<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
    var mycars = ["Saab","Volvo","BMW"];
    var len = mycars.length;    //获取数组长度
    for(i=0;i<len;i++){
       document.write(mycars[i]);
       document.write('<br/>');
    }

  </script>
 </body>
</html>
